/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.transformation.editor.internal;

import edu.pku.sei.modeler.model.core.MetaModel;
import edu.pku.sei.modeler.ui.palette.DiagramPaletteFactory;
import edu.pku.sei.modeler.ui.palette.EntryDescriptor;
import edu.pku.sei.transformation.editor.model.ModelPackage;
import edu.pku.sei.transformation.editor.views.icons.IconsProvider;

/**
 * @generated
 * 
 */
public class TransformationEditorPaletteFactory extends DiagramPaletteFactory {
	public static final String RULE_STRUCTURE_DIAGRAM = "Rule Structure";
	public static final String RULE_DIAGRAM = "Rule";
	public static final String TRANSFORMATION_COMPOSITE_DIAGRAM = "Transforamtion Composite";
	public static final String TRANSFORMATION_STRUCTURE_DIAGRAM = "Transformation Structure";
	public static final String TRANSFORMATION_EXECUTION = "Transformation Execution";
	public static final String TRANSFORMATION_DEPLOY = "Transformation Deploy";
	public static final String TRANSFORMATION_REQUIREMENT = "Transforamtion Requirement";
	public static final String TRANSFORMATION_TEST = "transformation test";
	public static final String MODEL_TYPE = "model type";

	private TransformationEditorPaletteFactory(MetaModel model) {
		super(model);
	}

	public static TransformationEditorPaletteFactory getDefault(MetaModel model) {
		DiagramPaletteFactory pFactory = model2factory.get(model);
		if (pFactory == null) {
			pFactory = new TransformationEditorPaletteFactory(model);
			// config the factory;

			addTransformationStructureItems(pFactory);
			addRuleStructureItems(pFactory);
			addRuleItems(pFactory);
			addExecutionItems(pFactory);
			addCompositeItems(pFactory);
			addRequirement(pFactory);
			addTestItem(pFactory);
			addModelTypeItems(pFactory);
			addDeployItem(pFactory);

			model2factory.put(model, pFactory);
		}
		return (TransformationEditorPaletteFactory) pFactory;
	}

	private static void addModelTypeItems(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = MODEL_TYPE;
		entry.elementType = ModelPackage.__MODEL_TYPE__;
		entry.isNode = true;
		entry.label = "ModelType";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.MODEL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = MODEL_TYPE;
		entry.elementType = ModelPackage.__CONSTRAINT__;
		entry.isNode = true;
		entry.label = "Constraint";
		entry.shortDesc = "Crate a constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXPRESSION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = MODEL_TYPE;
		entry.elementType = ModelPackage.__COMPETIBLE__;
		entry.isNode = false;
		entry.label = "Competible";
		entry.shortDesc = "Crate a competible between model types";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_TRIANGLE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = MODEL_TYPE;
		entry.elementType = ModelPackage.__CONSTRAINT_CONNECTION__;
		entry.isNode = false;
		entry.label = "Constraint Connection";
		entry.shortDesc = "Crate a constraint connection";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ICO);
		pFactory.addEntry(entry);
	}

	private static void addTransformationStructureItems(
			DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__ATOMIC_TRANSFORMATION__;
		entry.isNode = true;
		entry.label = "Atomic Transformation";
		entry.shortDesc = "Crate a transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.TRANSFORMATION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__COMPOSITE_TRANSFORMATION__;
		entry.isNode = true;
		entry.label = "Composite Transformation";
		entry.shortDesc = "Crate a transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.TRANSFORMATION_ICO);
		pFactory.addEntry(entry);

		// entry = new EntryDescriptor();
		// entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		// entry.elementType = ModelPackage.__METAMODEL__;
		// entry.isNode = true;
		// entry.label = "MetaModel";
		// entry.shortDesc = "Crate a transformation execution";
		// entry.iconSmall = IconsProvider
		// .getImageDescriptor(IconsProvider.MODEL_ICO);
		// pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__TYPED_MODEL__;
		entry.isNode = true;
		entry.label = "typed model";
		entry.shortDesc = "Crate a typed model";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.MODEL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__TRANSFORMATION_FORMAL_PARAMETER__;
		entry.isNode = false;
		entry.label = "formal parameter";
		entry.shortDesc = "Crate a formal parameter for transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__EXTEND__;
		entry.isNode = false;
		entry.label = "extend";
		entry.shortDesc = "Crate a generalization between transformations";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_TRIANGLE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__COMPOSITION__;
		entry.isNode = false;
		entry.label = "composition";
		entry.shortDesc = "Crate a composition between transformations";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_SOLID_DIAMOND_ICO);
		pFactory.addEntry(entry);
		
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__CONNECTOR__;
		entry.isNode = false;
		entry.label = "connector";
		entry.shortDesc = "Crate a composition between transformations";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_SOLID_DIAMOND_ICO);
		pFactory.addEntry(entry);

	}

	private static void addRuleStructureItems(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__RULE__;
		entry.isNode = true;
		entry.label = "Rule";
		entry.shortDesc = "Crate a Transformation Rule";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.RULE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__CONSTRAINT__;
		entry.isNode = true;
		entry.label = "Constraint";
		entry.shortDesc = "Crate a Constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.FILE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__PRECONDITION_INVOKE__;
		entry.isNode = false;
		entry.label = "Pre-condition";
		entry.shortDesc = "Crate a Pre-conditoin Connection";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__POSTCONDITION_INVOKE__;
		entry.isNode = false;
		entry.label = "Post-condition";
		entry.shortDesc = "Crate a Post-condition Connection";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__OVERRIDE__;
		entry.isNode = false;
		entry.label = "Override";
		entry.shortDesc = "Create a Override relationship between rules";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_TRIANGLE_ICO);
		pFactory.addEntry(entry);
		
		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__GRAPHICAL_DOMAIN__;
		entry.isNode = true;
		entry.label = "Domain";
		entry.shortDesc = "Crate a Graphical Domain";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.AREA_DIAGRAM_ICO);
		pFactory.addEntry(entry);

		// entry = new EntryDescriptor();
		// entry.diagramType = RULE_DIAGRAM;
		// entry.elementType = ModelPackage.__LITERAL_DOMAIN__;
		// entry.isNode = true;
		// entry.label = "LiteralDomain";
		// entry.shortDesc = "Crate a Literal Domain";
		// entry.iconSmall = IconsProvider
		// .getImageDescriptor(IconsProvider.LITERAL_DOMAIN_ICON);
		// pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__OBJECT_VARIABLE__;
		entry.isNode = true;
		entry.label = "Object";
		entry.shortDesc = "Crate a ObjectVariable";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.NODE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__EXPRESSION__;
		entry.isNode = true;
		entry.label = "Expression";
		entry.shortDesc = "Crate a Expression";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXPRESSION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__CONNECTION_VARIABLE__;
		entry.isNode = false;
		entry.label = "Connection";
		entry.shortDesc = "Crate a Connection Variable";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONNECTION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__LITERAL_TEMPLATE__;
		entry.isNode = true;
		entry.label = "template";
		entry.shortDesc = "Crate a literal template";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.AREA_TEXT_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_STRUCTURE_DIAGRAM;
		entry.elementType = ModelPackage.__COMMENT_CONNECTION__;
		entry.isNode = false;
		entry.label = "template Connection";
		entry.shortDesc = "Crate a Connection Variable";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ICO);
		pFactory.addEntry(entry);

	}

	private static void addRuleItems(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = RULE_DIAGRAM;
		entry.elementType = ModelPackage.__GRAPHICAL_DOMAIN__;
		entry.isNode = true;
		entry.label = "Domain";
		entry.shortDesc = "Crate a Graphical Domain";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.AREA_DIAGRAM_ICO);
		pFactory.addEntry(entry);

		// entry = new EntryDescriptor();
		// entry.diagramType = RULE_DIAGRAM;
		// entry.elementType = ModelPackage.__LITERAL_DOMAIN__;
		// entry.isNode = true;
		// entry.label = "LiteralDomain";
		// entry.shortDesc = "Crate a Literal Domain";
		// entry.iconSmall = IconsProvider
		// .getImageDescriptor(IconsProvider.LITERAL_DOMAIN_ICON);
		// pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_DIAGRAM;
		entry.elementType = ModelPackage.__OBJECT_VARIABLE__;
		entry.isNode = true;
		entry.label = "Object";
		entry.shortDesc = "Crate a ObjectVariable";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.NODE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_DIAGRAM;
		entry.elementType = ModelPackage.__EXPRESSION__;
		entry.isNode = true;
		entry.label = "Expression";
		entry.shortDesc = "Crate a Expression";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXPRESSION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_DIAGRAM;
		entry.elementType = ModelPackage.__CONNECTION_VARIABLE__;
		entry.isNode = false;
		entry.label = "Connection";
		entry.shortDesc = "Crate a Connection Variable";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONNECTION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_DIAGRAM;
		entry.elementType = ModelPackage.__LITERAL_TEMPLATE__;
		entry.isNode = true;
		entry.label = "template";
		entry.shortDesc = "Crate a literal template";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.AREA_TEXT_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = RULE_DIAGRAM;
		entry.elementType = ModelPackage.__COMMENT_CONNECTION__;
		entry.isNode = false;
		entry.label = "template Connection";
		entry.shortDesc = "Crate a Connection Variable";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ICO);
		pFactory.addEntry(entry);
	}

	private static void addExecutionItems(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_EXECUTION;
		entry.elementType = ModelPackage.__TRANSFROMATION_EXECUTION__;
		entry.isNode = true;
		entry.label = "transformation execution";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXECUTION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_EXECUTION;
		entry.elementType = ModelPackage.__MODEL__;
		entry.isNode = true;
		entry.label = "Model";
		entry.shortDesc = "Crate a Model";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.MODEL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_EXECUTION;
		entry.elementType = ModelPackage.__PIN__;
		entry.isNode = true;
		entry.label = "pin";
		entry.shortDesc = "Crate a pin";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.PIN_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_EXECUTION;
		entry.elementType = ModelPackage.__OBJECTFLOW__;
		entry.isNode = false;
		entry.label = "object flow";
		entry.shortDesc = "Crate a object flow";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_ARROW_ICO);
		pFactory.addEntry(entry);
	}

	private static void addCompositeItems(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__TRANSFROMATION_EXECUTION__;
		entry.isNode = true;
		entry.label = "Transformation Execution";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXECUTION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__COPY_TRANSFORMATION_EXECUTION__;
		entry.isNode = true;
		entry.label = "Copy";
		entry.shortDesc = "Crate a copy transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXECUTION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__MODEL__;
		entry.isNode = true;
		entry.label = "Model";
		entry.shortDesc = "Crate a model";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.MODEL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__PIN__;
		entry.isNode = true;
		entry.label = "Pin";
		entry.shortDesc = "add a pin to a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.PIN_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__OBJECTFLOW__;
		entry.isNode = false;
		entry.label = "Object Flow";
		entry.shortDesc = "Crate a object flow";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__CONTROLFLOW__;
		entry.isNode = false;
		entry.label = "Control Flow";
		entry.shortDesc = "Crate a control flow";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__INITIAL__;
		entry.isNode = true;
		entry.label = "initial node";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONTROL_INIT_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__FINAL__;
		entry.isNode = true;
		entry.label = "final node";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONTROL_FINAL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__FORK__;
		entry.isNode = true;
		entry.label = "fork";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONTROL_FORK_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__JOIN__;
		entry.isNode = true;
		entry.label = "join";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONTROL_JOIN_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__DICISION__;
		entry.isNode = true;
		entry.label = "dicision";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONTROL_DICISION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__MERGE__;
		entry.isNode = true;
		entry.label = "merge";
		entry.shortDesc = "Crate a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONTROL_MERGE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__CONSTRAINT__;
		entry.isNode = true;
		entry.label = "Constraint";
		entry.shortDesc = "Crate a constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXPRESSION_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_COMPOSITE_DIAGRAM;
		entry.elementType = ModelPackage.__CONSTRAINT_CONNECTION__;
		entry.isNode = false;
		entry.label = "constrain";
		entry.shortDesc = "Crate a constrain from requirement to constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ICO);
		pFactory.addEntry(entry);

	}

	private static void addRequirement(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_REQUIREMENT;
		entry.elementType = ModelPackage.__TRANSFORMATION_GOAL__;
		entry.isNode = true;
		entry.label = "Goal";
		entry.shortDesc = "Crate a goal";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.GOAL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_REQUIREMENT;
		entry.elementType = ModelPackage.__TRANSFORMATION_OPTIONAL_GOAL__;
		entry.isNode = true;
		entry.label = "Optional Goal";
		entry.shortDesc = "Crate a optional goal";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.GOAL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_REQUIREMENT;
		entry.elementType = ModelPackage.__CONSTRAINT__;
		entry.isNode = true;
		entry.label = "Constraint";
		entry.shortDesc = "Crate a constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXPRESSION_ICO);
		pFactory.addEntry(entry);

		// entry = new EntryDescriptor();
		// entry.diagramType = TRANSFORMATION_REQUIREMENT;
		// entry.elementType = ModelPackage.__REQUIRE_DESCRIPTION__;
		// entry.isNode = true;
		// entry.label = "Describe";
		// entry.shortDesc = "Crate a describe";
		// entry.iconSmall = IconsProvider
		// .getImageDescriptor(IconsProvider.EXPRESSION_ICO);
		// pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_REQUIREMENT;
		entry.elementType = ModelPackage.__GOAL_DEPENDENT__;
		entry.isNode = false;
		entry.label = "dependent";
		entry.shortDesc = "Crate a dependent relationship between requirements";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_REQUIREMENT;
		entry.elementType = ModelPackage.__GOAL_INCLUDE__;
		entry.isNode = false;
		entry.label = "include";
		entry.shortDesc = "Crate a include relationship between requirements";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ARROW_ICO);
		pFactory.addEntry(entry);

		/*
		 * entry = new EntryDescriptor(); entry.diagramType =
		 * TRANSFORMATION_REQUIREMENT; entry.elementType =
		 * ModelPackage.__REFINEMENT__; entry.isNode = false; entry.label =
		 * "refinement"; entry.shortDesc =
		 * "Crate a refinement relationship between requirements";
		 * entry.iconSmall = IconsProvider
		 * .getImageDescriptor(IconsProvider.LINK_ICON);
		 * pFactory.addEntry(entry);
		 * 
		 * entry = new EntryDescriptor(); entry.diagramType =
		 * TRANSFORMATION_REQUIREMENT; entry.elementType =
		 * ModelPackage.__REFINEMENT__; entry.isNode = false; entry.label =
		 * "refinement"; entry.shortDesc =
		 * "Crate a refinement relationship between requirements";
		 * entry.iconSmall = IconsProvider
		 * .getImageDescriptor(IconsProvider.LINK_ICON);
		 * pFactory.addEntry(entry);
		 */

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_REQUIREMENT;
		entry.elementType = ModelPackage.__CONSTRAINT_CONNECTION__;
		entry.isNode = false;
		entry.label = "constrain";
		entry.shortDesc = "Crate a constrain from requirement to constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ICO);
		pFactory.addEntry(entry);
	}

	private static void addTestItem(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__TEST_CASE__;
		entry.isNode = true;
		entry.label = "TestCase";
		entry.shortDesc = "Crate a test case";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.TEST_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__CHECK_POINT__;
		entry.isNode = true;
		entry.label = "CheckPoint";
		entry.shortDesc = "Crate a check point";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CHECKPOINT_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__ATOMIC_TRANSFROMATION_EXECUTION__;
		entry.isNode = true;
		entry.label = "Atomic Transformation Execution";
		entry.shortDesc = "Crate a transformation Execution to test";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXECUTION2_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__RULE_EXECUTION__;
		entry.isNode = true;
		entry.label = "Rule Execution";
		entry.shortDesc = "Crate a Rule Execution to test";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.EXECUTION2_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__MODEL__;
		entry.isNode = true;
		entry.label = "Model";
		entry.shortDesc = "Crate a model as data of transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.MODEL_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__PIN__;
		entry.isNode = true;
		entry.label = "pin";
		entry.shortDesc = "create a pin for a transformation execution";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_DASH_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__CONSTRAINT__;
		entry.isNode = true;
		entry.label = "constraint";
		entry.shortDesc = "add a constraint";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.FILE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__OBJECTFLOW__;
		entry.isNode = false;
		entry.label = "Object Flow";
		entry.shortDesc = "Crate a object flow";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_ARROW_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__CHECK_POINT_CONNECTION__;
		entry.isNode = false;
		entry.label = "CheckPoint Operand";
		entry.shortDesc = "add a operand to a check point";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_ICO);
		pFactory.addEntry(entry);

		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_TEST;
		entry.elementType = ModelPackage.__CONSTRAINT_CONNECTION__;
		entry.isNode = false;
		entry.label = "Constraint Connection";
		entry.shortDesc = "add a operand to a check point";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.LINE_ICO);
		pFactory.addEntry(entry);
	}
	
	public static void addDeployItem(DiagramPaletteFactory pFactory) {
		EntryDescriptor entry;
//		entry = new EntryDescriptor();
//		entry.diagramType = TRANSFORMATION_DEPLOY;
//		entry.elementType = ModelPackage.__ATOMIC_TRANSFORMATION__;
//		entry.isNode = true;
//		entry.label = "Atomic Transformation";
//		entry.shortDesc = "Crate a transformation";
//		entry.iconSmall = IconsProvider
//				.getImageDescriptor(IconsProvider.TRANSFORMATION_ICO);
//		pFactory.addEntry(entry);
		
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_DEPLOY;
		entry.elementType = ModelPackage.__TRANSFORAMTION_SOURCECODE__;
		entry.isNode = true;
		entry.label = "source code";
		entry.shortDesc = "Crate a transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.TRANSFORMATION_ICO);
		pFactory.addEntry(entry);
		
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_DEPLOY;
		entry.elementType = ModelPackage.__TRANSFORMATION_ENGINE__;
		entry.isNode = true;
		entry.label = "engine";
		entry.shortDesc = "Crate a transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.TRANSFORMATION_ICO);
		pFactory.addEntry(entry);
		
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_DEPLOY;
		entry.elementType = ModelPackage.__DEPLOYMENT__;
		entry.isNode = false;
		entry.label = "deploy";
		entry.shortDesc = "Crate a transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONNECTION_DASH_ICO);
		pFactory.addEntry(entry);
		
		entry = new EntryDescriptor();
		entry.diagramType = TRANSFORMATION_DEPLOY;
		entry.elementType = ModelPackage.__MANIFESTATION__;
		entry.isNode = false;
		entry.label = "manifest";
		entry.shortDesc = "Crate a transformation";
		entry.iconSmall = IconsProvider
				.getImageDescriptor(IconsProvider.CONNECTION_DASH_ICO);
		pFactory.addEntry(entry);
	}
}
